package com.dobbyspringside.modules.nosql.redis.pool;

import redis.clients.jedis.Protocol;

/**
 * redis连接信息
 * Created by liguoqing on 2016/3/1.
 */
public class ConnectionInfo {

    public static final String DEFAULT_PASSWORD = null;

    private int database = Protocol.DEFAULT_DATABASE; // 默认的数据库
    private int timeout = Protocol.DEFAULT_TIMEOUT; // 超时时间
    private String password = DEFAULT_PASSWORD; // 密码

    public ConnectionInfo() {
    }

    public ConnectionInfo(int database, String password, int timeout) {
        this.database = database;
        this.timeout = timeout;
        this.password = password;
    }


    public int getDatabase() {
        return database;
    }

    public void setDatabase(int database) {
        this.database = database;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "ConnectionInfo{" +
                "database=" + database +
                ", timeout=" + timeout +
                ", password='" + password + '\'' +
                '}';
    }
}
